#include "../include/header.h"

int continumax(char *outputstr, char *inputstr)
{
    if (NULL == inputstr || NULL == outputstr)
        return -1;

    unsigned int num_count = 0, start = 0, end = 0, i = 0, j =0;

    while (inputstr[j] != '\0') {
        if (inputstr[j] <= '9' && inputstr[j] >= '0') {
            num_count++;
            if (num_count == 1)
                i = j;
            if (num_count > end - start + 1) {
                start = i;
                end = j;
            }

        } else {


            num_count = 0;
        }
        j++;
    }

    for (i = start, j = 0; i <= end ; i++, j++) {
        outputstr[j] = inputstr[i];
    }

    outputstr[j] = '\0';

    return end - start + 1;
}


void TestFor25()
{

    const unsigned int count = 100;

    char in[count], out[count];

    cout << "please input your string :" << endl;
    cin >> in;

    int i = continumax(out, in);

    cout << i << endl
         << out << endl;
}
